﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EnheimGallery.DAL.SystemDAL
{
    public class SysMessageData
    {
        public DateTime CreateDate;
        public string Description;
    }

    public static class SystemMessagesDAL
    {
        public static List<SysMessageData> SystemMessagesInfo()
        {
            EnheimGalleryEntities db = new EnheimGalleryEntities();
            var newMessages = from message in db.SystemMessages
                               select new SysMessageData{ CreateDate = message.AddedDate, Description = message.Description };
            
            List<SysMessageData> messagesList = newMessages.ToList();
            return messagesList;
        }
    }
}
